$(function () {
    let user = JSON.parse(sessionStorage.getItem("user"));
    let user_name = user.name == null ? "完善信息" : user.name;
    $("#user").text(user_name);
})

function editUser() {
    window.location.href = "../html/user/edituser.html";
}

function exitUser() {
    let flag = confirm("确定要退出吗？");
    if (flag) {
        alert("退出成功！");
        sessionStorage.clear();
        myAjax("/user/exit", "get", {}, "json");
        window.location.href = "../html/login.html";
    }
}